﻿<!doctype html>
<html>
<!-- InstanceBegin template="/Templates/template1.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta charset="utf-8">
<!-- InstanceBeginEditable name="doctitle" -->
<title>前台抽奖活动管理</title>
<!-- InstanceEndEditable -->

<script type="text/javascript" src="../js/common.js"></script>
<script type="text/javascript" src="../js/checkLogin.js"></script> 
<link href="../css/Pager.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="../js/jquery.pager.js"></script>
<script type="text/javascript" src="../js/gbRst.js"></script>
<script type="text/javascript" src="../js/doubleDate2.0.js"></script>
	<script type="text/javascript" src="../js/utils.js"></script>
	<script type="text/javascript" src="../js/find.js"></script>
	<script type="text/javascript" src="../js/pagination.js"></script>
	<script type="text/javascript" src="../js/activitySelecterNew.js"></script>
	<link href="../css/style.css" type="text/css" rel="stylesheet" />


<script type="text/javascript">

$(function(){
	getSwpType();
})

function getSwpType(){
	var dt  = _findInfo("../sweepstakes/find/cjType", null)
	if(IsNotEmpty(dt)&&dt.state==0){
		loadInfo(dt)
	}
}

function loadInfo(dt){
	for ( var i = 0; i < dt.result.data.length; i++) {
		var typeId = getHeadIndexValue(i, dt, "typeId");
		var swpId = getHeadIndexValue(i, dt, "swpId")
		var swpName = getHeadIndexValue(i, dt, "swpName")
		var intAmt = getHeadIndexValue(i, dt, "intAmt")
		var status = getHeadIndexValue(i, dt, "status")
		var op = "<option value="+swpId+">"+swpName+"</option>"
		if(typeId==1){
			$("#swpId1").html(op)
			$("#state1").val(status)
			$("#intAmt1").val(intAmt)
		}
		
		if(typeId==2){
			$("#swpId2").html(op)
			$("#state2").val(status)
			$("#intAmt2").val(intAmt)
		}
		
	}
}

function saveType1(){
	var swpId = $("#swpId1").val();
	var state=$("#state1").val();
	var intAmt = $("#intAmt1").val();
	
	var heads = new Array("swpId","intAmt","status","id")
	var datas = new Array(swpId,intAmt,state,1)
	var editJoin = _getJsonParseEditStr(heads, datas);	
	var dt = _editInfo("../sweepstakes/edit/editSwpSet", {'data':editJoin});
}
function saveType2(){
	var swpId = $("#swpId2").val();
	var state=$("#state2").val();
	var intAmt = $("#intAmt2").val();
	
	var heads = new Array("swpId","intAmt","status","id")
	var datas = new Array(swpId,intAmt,state,2)
	var editJoin = _getJsonParseEditStr(heads, datas);
	alert(editJoin)
	
	var dt = _editInfo("../sweepstakes/edit/editSwpSet", {'data':editJoin});
}

</script>

</head>

<body>
<!-- InstanceBeginEditable name="EditRegion3" --> 


<div class="container" id="container">
  <div class="container_R fr">
      <div class="place"><a onclick='returnURL()' href='javaScript:void(0)'>投诉建议</a><span> &gt; <span>添加<a class="goHome" onclick='returnURL()' href='javaScript:void(0)'>返回</a></div>
    <div class="member_search publish"  style="padding:0;">
    <div class="knowPerson">
      <p class="knowAll">
        <label> <span>类型一：</span>
        大于指定积分数的会员可以参加
        </label>
        
        </p>
      <p class="knowAll">
        <label> <span>活动名称：</span>
         <select id="swpId1" onclick="openActivityListPanel(this)">
  
         </select>
        </label>
        
        </p>
      <p class="knowAll" id="mInfo">
        <label> <span>积分大于：</span>
          <input type="text"  id="intAmt1">
        </label>
        
        </p>
        <p class="knowAll">
        <label> <span>活动状态：</span>
         <select id="state1" >
  			<option value="0">使用</option>
  			<option value="1">停用</option>
         </select>
        </label>
        
        </p>  
         <div class="BottomBtn">
            <input id="cl_btn" type="button" value="确定" onclick="saveType1()">      
            </div>
      </div>
  
      	<p>
      	<div style="display: none;" class="knowPerson">
      <p class="knowAll">
        <label> <span>类型二：</span>
        	每次消耗指定积分可以参加抽奖
        </label>
        
        </p>
      <p class="knowAll">
        <label> <span>活动名称：</span>
         <select id="swpId2" onclick="openActivityListPanel(this)">
  
         </select>
        </label>
        
        </p>
      <p class="knowAll" id="mInfo">
        <label> <span>消耗积分数：</span>
          <input type="text"  id="intAmt2">
        </label>
        
        </p>
        <p class="knowAll">
        <label> <span>活动状态：</span>
         <select id="state2" >
  			<option value="0">使用</option>
  			<option value="1">停用</option>
         </select>
        </label>
        
        </p>  
      </div>
      <p> 
        <div style="display: none;" class="BottomBtn">
            <input id="cl_btn" type="button" value="提交" onclick="saveType2()">      
            </div>
       </div>  
  </div>
    <div class="fc"></div>
  
</div>
<!-- InstanceEndEditable --> 
<script type="text/javascript" src="../js/header.js"></script> 
<script type="text/javascript" src="../js/left.js"></script> 
<script type="text/javascript" src="../js/footer.js"></script> 
<script type="text/javascript">
clearThis("absoluteTxt");
showTab(4, 9);
</script>
</body>
<!-- InstanceEnd -->
</html>
